using System;
using Microsoft.AspNetCore.Mvc;
using ApiProject.Api.Entity;
using System.Linq;
using ApiProject.Api.Repository;
using Microsoft.Extensions.Configuration;
using ApiProject.Api.PramaModel;
using ApiProject.Api.Uitls;
using Microsoft.AspNetCore.Authorization;


// 文章类型管理
namespace ApiProject.Api.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class AllarticleTypeController : ControllerBase
    {
        private IRepository<ArticleTypes> _articleTypeRepository;

        public AllarticleTypeController(

            IRepository<ArticleTypes> articleTypeRepository

        )
        {
            _articleTypeRepository = articleTypeRepository;

        }

        // 获取所有文章类型
        // Get /articletype
        [HttpGet]
        public dynamic Getss()
        {

            var allType = _articleTypeRepository.Table.Where(x => x.IsDelete == false && x.IsEnable == true).ToList();

            return JsonHelper.Serialize(new
            {
                Code = 200,
                Data = allType
            });
        }


    }
}







